package com.zhekou.web.ext;

import net.sourceforge.stripes.config.Configuration;
import net.sourceforge.stripes.exception.ExceptionHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * User: chjp
 * Date: 10-12-18
 * Time: 下午8:29
 */
public class MyExceptionHandler implements ExceptionHandler {


    public void handle(Throwable exc, HttpServletRequest req,
                       HttpServletResponse resp)
            throws ServletException, IOException {
        exc.printStackTrace();
        req.getRequestDispatcher("/error.jsp").forward(req, resp);
    }

    public void init(Configuration configuration) {
    }
}
